#include "includes.h"

OS_STK task1_stk[100];
OS_STK task2_stk[100];


void task1(void *date) reentrant;
void task2(void *date) reentrant;

void main(void)
{
  lcd_init()	;
	InitSerial();
	InitTimer0();
	InitSerialBuffer();
	OSInit();
	
	OSTaskCreate(task1, (void *)0, &task1_stk[0], 10);
	OSTaskCreate(task2, (void *)0, &task2_stk[0], 5);
	
	OSStart();
}
void task1(void *date) reentrant
{
	INT8U time,err=1;
  date=date;
	while(1)
	{
		 if(time == 5)
		 {
			time= 0; 
			err=OSTaskChangePrio(10,4);
			wr_lcd_num(1,1,err);
		 }
		 
		 time++;
		 wr_lcd_num(0,1,time);

		PrintStr("11111111 \n");
    OSTimeDly(30);		 
		 
  }
}
void task2(void *date) reentrant
{
  date=date;
	while(1)
	{
    PrintStr("222222222 \n");
    OSTimeDly(30);	
  }
}